<?php

declare(strict_types=1);

namespace app\admin\controller;

use app\admin\service\interface\UserService;
use think\facade\View;

// use app\admin\service\UserServiceImpl;

class User
{
    /**
     * @var UserService
     */
    private $userService;
    public function __construct(UserService $userService) {
        $this->userService = $userService;
    }
    public function register()
    {
        # code...
        try {
            $this->userService->register("eeeee", "ddddd");
            return "ok!";
        } catch (\Throwable $th) {
            //throw $th;
            return $th->getMessage();
        }
       
    }
    public function index() 
    {
        # code...
        return View::fetch();
    }
    public function add() 
    {
        # code...
        return View::fetch();
    }
}
